﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace _20.Exercise
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = "abba car boll lamal exe goal";
            MatchCollection words = Regex.Matches(text, @"\w+");
            foreach (Match item in words)
            {
                string word = item.Value;
                bool check = true;
                for (int i = 0; i < word.Length/2; i++)
                {                    
                    if (word[i]!=word[word.Length-1-i])
                    {
                        check = false;
                        break;
                    }
                }
                if (check)
                {
                    Console.WriteLine(word);
                }
            }
        }
    }
}
